package com.example.message_wall.mapper;

import com.example.message_wall.model.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.Mapping;

import java.util.List;

@Mapper
public interface MessageMapper {
    //查询述
    @Select("select * from message_info")
    List<MessageInfo> queryAllMessage();

    //插入留言
    @Insert("insert into message_info(`from`, `to`, message) values (#{from}, #{to}, #{message})")
    void insertMessage(MessageInfo messageInfo);

}
